//统一设置el-table的样式

//表头样式
export function handleHeader() {
    return {
        background:'#58AAFF',color:'#fff',lineHeight:'12px',padding:'0px',height:'34px',textAlign:'center'
    }
}
export function rowStyle() {
    return {
        height:'33px',
        lineHeight:'10px',
        padding:'0px'
    }
}
export function cellStyle() {
    return {
        padding:'0px'
    }
}
export function toolStyle() {
    return 'center'
}
//分页方法抽象
export function dataPage(data,currentPage,pageSize) {
    if (data.length > 10) {
        return {
            pageData:data.slice((currentPage - 1) * pageSize,currentPage * pageSize)
        }
    }
    else {
        return {pageData:data}
    }
}
//保留两位小数方法
export function fixTwo(row, column) {
    return parseFloat(row[column.property]).toFixed(2)
}
//表标题
export function tableTitle(row, column) {
    return parseFloat(row[column.property]).toFixed(2)
}
//图标题
export function graphTitle(row, column) {
    return parseFloat(row[column.property]).toFixed(2)
}
